.class public Lcom/bitauto/autoeasy/selectcar/CommentActivity;
.super Landroid/app/Activity;
.source "CommentActivity.java"

# interfaces
.implements Landroid/view/View$OnClickListener;
.implements Landroid/widget/AdapterView$OnItemClickListener;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/bitauto/autoeasy/selectcar/CommentActivity$downLoadTask;
    }
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/app/Activity;",
        "Landroid/view/View$OnClickListener;",
        "Landroid/widget/AdapterView$OnItemClickListener;"
    }
.end annotation


# instance fields
.field private final AUTHOR:Ljava/lang/String;

.field private BUTTONSIZE:I

.field private final CONTENT:Ljava/lang/String;

.field private final DATE:Ljava/lang/String;

.field private button:[Landroid/widget/Button;

.field private commentParser:Lcom/bitauto/autoeasy/selectcar/Object/CommentParser;

.field private list:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lcom/bitauto/autoeasy/selectcar/Object/Comment;",
            ">;"
        }
    .end annotation
.end field

.field private listView:Landroid/widget/ListView;

.field private suffix:I

.field private title:Ljava/lang/String;


# direct methods
.method public constructor <init>()V
    .locals 1

    .prologue
    .line 26
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    .line 28
    const-string v0, "date"

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->DATE:Ljava/lang/String;

    .line 29
    const-string v0, "author"

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->AUTHOR:Ljava/lang/String;

    .line 30
    const-string v0, "content"

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->CONTENT:Ljava/lang/String;

    .line 32
    const/4 v0, 0x3

    iput v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->BUTTONSIZE:I

    .line 33
    iget v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->BUTTONSIZE:I

    new-array v0, v0, [Landroid/widget/Button;

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->button:[Landroid/widget/Button;

    .line 34
    const-string v0, ""

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->title:Ljava/lang/String;

    .line 26
    return-void
.end method


# virtual methods
.method public changeButtonBg(I)V
    .locals 6
    .parameter "num"

    .prologue
    const-string v5, "["

    .line 149
    const/4 v0, 0x0

    .local v0, i:I
    :goto_0
    iget v2, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->BUTTONSIZE:I

    if-lt v0, v2, :cond_0

    .line 161
    return-void

    .line 150
    :cond_0
    const/4 v1, 0x0

    .line 151
    .local v1, str:Ljava/lang/String;
    if-ne v0, p1, :cond_2

    .line 152
    iget-object v2, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->button:[Landroid/widget/Button;

    aget-object v2, v2, v0

    invoke-virtual {v2}, Landroid/widget/Button;->getText()Ljava/lang/CharSequence;

    move-result-object v2

    invoke-interface {v2}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;

    move-result-object v1

    .line 153
    const-string v2, "["

    invoke-virtual {v1, v5}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v2

    if-nez v2, :cond_1

    .line 154
    iget-object v2, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->button:[Landroid/widget/Button;

    aget-object v2, v2, v0

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "["

    invoke-direct {v3, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    const-string v4, "]"

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/Button;->setText(Ljava/lang/CharSequence;)V

    .line 149
    :cond_1
    :goto_1
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 156
    :cond_2
    iget-object v2, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->button:[Landroid/widget/Button;

    aget-object v2, v2, v0

    invoke-virtual {v2}, Landroid/widget/Button;->getText()Ljava/lang/CharSequence;

    move-result-object v2

    invoke-interface {v2}, Ljava/lang/CharSequence;->toString()Ljava/lang/String;

    move-result-object v1

    .line 157
    const-string v2, "["

    invoke-virtual {v1, v5}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_1

    .line 158
    iget-object v2, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->button:[Landroid/widget/Button;

    aget-object v2, v2, v0

    const/4 v3, 0x1

    const/4 v4, 0x3

    invoke-virtual {v1, v3, v4}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Landroid/widget/Button;->setText(Ljava/lang/CharSequence;)V

    goto :goto_1
.end method

.method public downLoadData()V
    .locals 3

    .prologue
    .line 63
    new-instance v0, Lcom/bitauto/autoeasy/selectcar/Object/CommentParser;

    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "http://m.bitauto.com/iphoneapi/v2/listkoubei/?carid="

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget v2, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->suffix:I

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/bitauto/autoeasy/selectcar/Object/CommentParser;-><init>(Ljava/lang/String;)V

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->commentParser:Lcom/bitauto/autoeasy/selectcar/Object/CommentParser;

    .line 64
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->commentParser:Lcom/bitauto/autoeasy/selectcar/Object/CommentParser;

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/selectcar/Object/CommentParser;->Paser2Object()V

    .line 65
    return-void
.end method

.method public onClick(Landroid/view/View;)V
    .locals 3
    .parameter "v"

    .prologue
    .line 82
    invoke-virtual {p1}, Landroid/view/View;->getId()I

    move-result v0

    packed-switch v0, :pswitch_data_0

    .line 112
    :cond_0
    :goto_0
    return-void

    .line 84
    :pswitch_0
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->changeButtonBg(I)V

    .line 85
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->commentParser:Lcom/bitauto/autoeasy/selectcar/Object/CommentParser;

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/selectcar/Object/CommentParser;->getGoodCommentList()Ljava/util/ArrayList;

    move-result-object v0

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->list:Ljava/util/ArrayList;

    .line 86
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->list:Ljava/util/ArrayList;

    if-eqz v0, :cond_0

    .line 87
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->listView:Landroid/widget/ListView;

    new-instance v1, Lcom/bitauto/autoeasy/selectcar/Adapter/CommentAdapter;

    iget-object v2, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->list:Ljava/util/ArrayList;

    invoke-direct {v1, v2, p0}, Lcom/bitauto/autoeasy/selectcar/Adapter/CommentAdapter;-><init>(Ljava/util/ArrayList;Landroid/content/Context;)V

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    goto :goto_0

    .line 93
    :pswitch_1
    const/4 v0, 0x1

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->changeButtonBg(I)V

    .line 94
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->commentParser:Lcom/bitauto/autoeasy/selectcar/Object/CommentParser;

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/selectcar/Object/CommentParser;->getGeneralCommentList()Ljava/util/ArrayList;

    move-result-object v0

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->list:Ljava/util/ArrayList;

    .line 95
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->list:Ljava/util/ArrayList;

    if-eqz v0, :cond_0

    .line 96
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->listView:Landroid/widget/ListView;

    new-instance v1, Lcom/bitauto/autoeasy/selectcar/Adapter/CommentAdapter;

    iget-object v2, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->list:Ljava/util/ArrayList;

    invoke-direct {v1, v2, p0}, Lcom/bitauto/autoeasy/selectcar/Adapter/CommentAdapter;-><init>(Ljava/util/ArrayList;Landroid/content/Context;)V

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    goto :goto_0

    .line 102
    :pswitch_2
    const/4 v0, 0x2

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->changeButtonBg(I)V

    .line 103
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->commentParser:Lcom/bitauto/autoeasy/selectcar/Object/CommentParser;

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/selectcar/Object/CommentParser;->getBadcommentList()Ljava/util/ArrayList;

    move-result-object v0

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->list:Ljava/util/ArrayList;

    .line 104
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->list:Ljava/util/ArrayList;

    if-eqz v0, :cond_0

    .line 105
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->listView:Landroid/widget/ListView;

    new-instance v1, Lcom/bitauto/autoeasy/selectcar/Adapter/CommentAdapter;

    iget-object v2, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->list:Ljava/util/ArrayList;

    invoke-direct {v1, v2, p0}, Lcom/bitauto/autoeasy/selectcar/Adapter/CommentAdapter;-><init>(Ljava/util/ArrayList;Landroid/content/Context;)V

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    goto :goto_0

    .line 82
    nop

    :pswitch_data_0
    .packed-switch 0x7f0b0053
        :pswitch_0
        :pswitch_1
        :pswitch_2
    .end packed-switch
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 5
    .parameter "savedInstanceState"

    .prologue
    const/4 v4, 0x1

    const/4 v3, 0x0

    .line 44
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 46
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    const-string v1, "carid"

    invoke-virtual {v0, v1, v3}, Landroid/content/Intent;->getIntExtra(Ljava/lang/String;I)I

    move-result v0

    iput v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->suffix:I

    .line 47
    invoke-virtual {p0}, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->getIntent()Landroid/content/Intent;

    move-result-object v0

    const-string v1, "title"

    invoke-virtual {v0, v1}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->title:Ljava/lang/String;

    .line 49
    const v0, 0x7f030020

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->setContentView(I)V

    .line 51
    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->button:[Landroid/widget/Button;

    const v0, 0x7f0b0053

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/Button;

    aput-object v0, v1, v3

    .line 52
    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->button:[Landroid/widget/Button;

    const v0, 0x7f0b0054

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/Button;

    aput-object v0, v1, v4

    .line 53
    iget-object v1, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->button:[Landroid/widget/Button;

    const/4 v2, 0x2

    const v0, 0x7f0b0055

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/Button;

    aput-object v0, v1, v2

    .line 56
    const v0, 0x102000a

    invoke-virtual {p0, v0}, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ListView;

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->listView:Landroid/widget/ListView;

    .line 57
    new-instance v0, Lcom/bitauto/autoeasy/selectcar/CommentActivity$downLoadTask;

    invoke-direct {v0, p0}, Lcom/bitauto/autoeasy/selectcar/CommentActivity$downLoadTask;-><init>(Lcom/bitauto/autoeasy/selectcar/CommentActivity;)V

    new-array v1, v4, [Ljava/lang/String;

    const-string v2, ""

    aput-object v2, v1, v3

    invoke-virtual {v0, v1}, Lcom/bitauto/autoeasy/selectcar/CommentActivity$downLoadTask;->execute([Ljava/lang/Object;)Landroid/os/AsyncTask;

    .line 58
    invoke-virtual {p0, v3}, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->changeButtonBg(I)V

    .line 60
    return-void
.end method

.method public onItemClick(Landroid/widget/AdapterView;Landroid/view/View;IJ)V
    .locals 4
    .parameter
    .parameter "view"
    .parameter "position"
    .parameter "id"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/widget/AdapterView",
            "<*>;",
            "Landroid/view/View;",
            "IJ)V"
        }
    .end annotation

    .prologue
    .line 117
    .local p1, parent:Landroid/widget/AdapterView;,"Landroid/widget/AdapterView<*>;"
    iget-object v2, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->list:Ljava/util/ArrayList;

    invoke-virtual {v2, p3}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/bitauto/autoeasy/selectcar/Object/Comment;

    .line 118
    .local v0, com:Lcom/bitauto/autoeasy/selectcar/Object/Comment;
    new-instance v1, Landroid/content/Intent;

    const-class v2, Lcom/bitauto/autoeasy/selectcar/CommentDetailActivity;

    invoke-direct {v1, p0, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 119
    .local v1, intent:Landroid/content/Intent;
    const-string v2, "title1"

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/selectcar/Object/Comment;->getTitle()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 120
    const-string v2, "date"

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/selectcar/Object/Comment;->getUpdated()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 121
    const-string v2, "author"

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/selectcar/Object/Comment;->getAuthor()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 122
    const-string v2, "content"

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/selectcar/Object/Comment;->getContent()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 123
    const-string v2, "title"

    iget-object v3, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->title:Ljava/lang/String;

    invoke-virtual {v1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 124
    invoke-virtual {p0, v1}, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->startActivity(Landroid/content/Intent;)V

    .line 125
    return-void
.end method

.method public refreshView()V
    .locals 3

    .prologue
    .line 68
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->button:[Landroid/widget/Button;

    const/4 v1, 0x0

    aget-object v0, v0, v1

    invoke-virtual {v0, p0}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 69
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->button:[Landroid/widget/Button;

    const/4 v1, 0x1

    aget-object v0, v0, v1

    invoke-virtual {v0, p0}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 70
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->button:[Landroid/widget/Button;

    const/4 v1, 0x2

    aget-object v0, v0, v1

    invoke-virtual {v0, p0}, Landroid/widget/Button;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    .line 71
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->commentParser:Lcom/bitauto/autoeasy/selectcar/Object/CommentParser;

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/selectcar/Object/CommentParser;->getGoodCommentList()Ljava/util/ArrayList;

    move-result-object v0

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->list:Ljava/util/ArrayList;

    .line 72
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->list:Ljava/util/ArrayList;

    if-eqz v0, :cond_0

    .line 73
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->listView:Landroid/widget/ListView;

    invoke-virtual {v0, p0}, Landroid/widget/ListView;->setOnItemClickListener(Landroid/widget/AdapterView$OnItemClickListener;)V

    .line 74
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->listView:Landroid/widget/ListView;

    new-instance v1, Lcom/bitauto/autoeasy/selectcar/Adapter/CommentAdapter;

    iget-object v2, p0, Lcom/bitauto/autoeasy/selectcar/CommentActivity;->list:Ljava/util/ArrayList;

    invoke-direct {v1, v2, p0}, Lcom/bitauto/autoeasy/selectcar/Adapter/CommentAdapter;-><init>(Ljava/util/ArrayList;Landroid/content/Context;)V

    invoke-virtual {v0, v1}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    .line 78
    :cond_0
    return-void
.end method
